# 使用 read() 方法
with open('example.txt', 'r') as file:
    content = file.read()
    print(content)

# 使用 readline() 方法
with open('example.txt', 'r') as file:
    while True:
        line = file.readline()
        if not line:
            break
        print(line.strip())

# 使用 readlines() 方法
with open('example.txt', 'r') as file:
    lines = file.readlines()
    for line in lines:
        print(line.strip())
